package com.liuxinlong.jobs;

import com.liuxinlong.constant.TimeFormatConstants;
import com.liuxinlong.modules.assets.service.AssetsOrderService;
import com.liuxinlong.utils.TimeUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * 使用quartz框架
 */
@Service
@Slf4j
@Component("syncOrderInfoTask")
public class SyncOrderInfoTask {

    @Autowired
    private AssetsOrderService assetsOrderService;

    /**
     * 业务逻辑
     */
    public void reptilian(){
        log.info("SyncOrderInfoTask start...");
        Map<String,Object> param = new HashMap<>();
        String startDate = TimeUtils.getBeforeDay(TimeUtils.getDate(TimeFormatConstants.YYYY_MM_DD),1,TimeFormatConstants.YYYY_MM_DD);
        param.put("startDate",startDate);
        assetsOrderService.syncAssetsOrderInfo(param);
    }
}
